<template>
    <div>
       <!-- pinia-actions -->
       
       <h2> 实现更多高级用法 pinia </h2>
       count:  {{count}}
       doubleCount: {{doubleCount}}
       <button @click="changeCount">count++</button>
       <Child />
    </div>
</template>
<script setup lang='ts'>
import { storeToRefs } from 'pinia'
import { useCounterStore } from './stores/counter'
import Child from './子组件.vue'
const counterStore = useCounterStore()
const { count, doubleCount } = storeToRefs(counterStore)
const changeCount = () => {
   // 其他逻辑.。
   // 之后更新state
   counterStore.increment1()
}

</script>


<style lang='scss' scoped>

</style>